<template>
    <div>
        <div class="head">
            <span class="iconfont icon-arrow-left-bold" @click="gotoUp"></span>
            <div class="title">我的邀请码</div>
        </div>
        <div class="content">
            <div class="item-box">
                <div class="left">
                    <div class="value">U137886954</div>
                    <div class="tit">我的邀请码</div>
                    <div class="copy">复制</div>
                </div>
                <div class="right">
                    <div class="value">￥0</div>
                    <div class="tit">邀请奖励金</div>
                </div>
            </div>
            <div class="info">
                <p>邀请者分享邀请链接给其他人下单成功后，将的到如下对应金额奖励：</p>
                <p>邀请人奖励：0元</p>
                <p>被邀请人奖励：0元</p>
                <p>订单抽成：0%</p>
            </div>
        </div>
        <van-tabs v-model="activeName" title-inactive-color="#333" title-active-color="#3ca7fa">
            <van-tab title="邀请记录" name="a">
                <div class="img">
                    <div class="imgbox">
                        <img src="http://h5.xiaomage.tech/static/img/img-placeholder.02168418.png" alt="" />
                    </div>
                </div>
            </van-tab>
            <van-tab title="资金详细" name="b">
                <div class="img">
                    <div class="imgbox">
                        <img src="http://h5.xiaomage.tech/static/img/img-placeholder.02168418.png" alt="" />
                    </div>
                </div>
            </van-tab>
            <van-tab title="提现明细" name="c">
                <div class="img">
                    <div class="imgbox">
                        <img src="http://h5.xiaomage.tech/static/img/img-placeholder.02168418.png" alt="" />
                    </div>
                </div>
            </van-tab>
        </van-tabs>
    </div>
</template>

<script>
import Vue from "vue";
import { Tab, Tabs } from "vant";
Vue.use(Tab).use(Tabs);
export default {
    data() {
        return {
            activeName: "a",
        };
    },
    methods: {
        gotoUp() {
            this.$router.push({
                path: "/user",
                query: {},
            });
        },
    },
};
</script>

<style lang="less" scoped>
/deep/ .van-tabs__wrap {
    height: 55px;
    box-shadow: 0 2px 4px 0 hsl(0deg 0% 80% / 20%);
}

/deep/ .van-tabs__nav {
    z-index: 999;
}

/deep/ .van-tabs__line {
    width: 55px;
    height: 4px;
    background: #3ca7fa;
    border-radius: 0;
}

/deep/ .van-tab--active {
    span {
        font-weight: 600;
        color: #3ca7fa;
    }
}
.head {
    position: fixed;
    top: 0;
    width: 100%;
    height: 50px;
    background-color: #fff;
    z-index: 100;
    padding-left: 15px;
    padding-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f1f2f6;
    span {
        font-size: 19px;
        position: absolute;
        top: 50%;
        margin-top: -10px;
        left: 4%;
    }
    .title {
        flex: 1;
        font-size: 17px;
        font-weight: 500;
        text-align: center;
        color: #333;
        line-height: 22px;
        overflow: hidden;
    }
}
.content {
    margin-top: 50px;
    width: 100%;
    max-height: 355px;
    background: #1784ed;
    padding: 30px 15px 20px 15px;
    .item-box {
        width: 345px;
        background: linear-gradient(180deg, #fff6cf, #ffeaa1);
        border-radius: 4px;
        margin: 0 auto;
        display: flex;
        flex-direction: row;
        .left {
            width: 50%;
            display: flex;
            flex-direction: column;
            padding-top: 30px;
            padding-bottom: 30px;
            padding-left: 15px;
            .value {
                width: 100%;
                font-size: 20px;
                font-weight: 500;
                color: #333;
                line-height: 20px;
                margin-bottom: 20px;
                text-align: center;
            }

            .tit {
                display: inline-block;
                height: 13px;
                font-size: 13px;
                font-weight: 400;
                color: #666;
                line-height: 13px;
                margin-left: 50px;
            }
            .copy {
                width: 96px;
                height: 30px;
                border-radius: 15px;
                border: 1px solid #1784ed;
                cursor: pointer;
                margin-top: 20px;
                font-size: 14px;
                font-weight: 400;
                color: #1784ed;
                display: flex;
                align-items: center;
                justify-content: center;
                margin-left: 50px;
            }
        }
        .right {
            width: 50%;
            display: flex;
            flex-direction: column;
            padding-top: 30px;
            padding-bottom: 30px;
            padding-right: 15px;
            .value {
                width: 100%;
                font-size: 20px;
                font-weight: 500;
                color: #333;
                line-height: 20px;
                margin-bottom: 20px;
                text-align: center;
            }
            .tit {
                display: inline-block;
                height: 13px;
                font-size: 13px;
                font-weight: 400;
                color: #666;
                line-height: 13px;
                margin-left: 50px;
            }
        }
    }
    .info {
        width: 100%;
        height: 119px;
        display: flex;
        flex-direction: column;
        margin-top: 22px;
        p {
            width: 100%;
            font-size: 13px;
            font-weight: 400;
            color: #fff;
            line-height: 19px;
            margin-bottom: 8px;
        }
        p:nth-child(4) {
            margin-bottom: 0;
        }
    }
}
.img {
    width: 100%;
    display: flex;
    .imgbox {
        width: 100%;
        text-align: center;
        padding-top: 50px;
        padding-bottom: 50px;
        display: flex;
        justify-content: center;
        img {
            width: 120px;
            height: 120px;
        }
    }
}
</style>
